package com.thinksns.sociax.photograph.gui.fragments;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;

import com.thinksns.sociax.android.R;
import com.thinksns.sociax.photograph.gui.adapters.WorksAdapter;
import com.thinksns.sociax.photograph.model.PhotographModel;
import com.thinksns.sociax.t4.android.fragment.FragmentSociax;
import com.thinksns.sociax.t4.android.interfaces.OnTabListener;
import com.thinksns.sociax.t4.android.video.ToastUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import butterknife.BindView;

/**
 * Description
 @author Linsr
 */

public class WorksFragment extends FragmentSociax implements OnTabListener{

    private WorksAdapter mWorksAdapter;
    private List<PhotographModel> mList;

    private RecyclerView mRecyclerView;

    @Override
    public int getLayoutId() {
        return R.layout.fragment_works;
    }

    @Override
    public void initView() {
        mRecyclerView = (RecyclerView) findViewById(R.id.works_recycler_view);
        mList= new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < 20; i++) {
            PhotographModel model = new PhotographModel();
            model.setWidth(random.nextInt(1080));
            model.setHeight(random.nextInt(1920));
            mList.add(model);
        }
        mWorksAdapter = new WorksAdapter(getActivity(), mList);
        mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(3,
                StaggeredGridLayoutManager.VERTICAL));
        mRecyclerView.setAdapter(mWorksAdapter);
    }

    @Override
    public void initIntentData() {

    }

    @Override
    public void initListener() {


    }

    @Override
    public void initData() {

    }

    @Override
    public void onTabClickListener() {
        ToastUtils.showLongToast("aaa");
    }
}
